import request from '@/utils/request'
import { getToken } from '@/utils/auth'
var token = getToken();
export function getList (startTime, endTime, userName, page, pageSize, projectId, salesOrderId, userIdCard, userPhone) {
  return request({
    url: '/pc/management/order/getlist',
    method: 'post',
    data: {
      token: token,
      draw: 1,
      startTime: startTime,
      endTime: endTime,
      page: page,
      pageSize: pageSize,
      userIdCard: userIdCard,
      projectId: projectId,
      salesOrderId: salesOrderId,
      userName: userName,
      userPhone: userPhone
    }
  })
}
export function getDetail (id) {
  return request({
    url: '/pc/management/order/detailOrder',
    method: 'post',
    data: {
      token: token,
      id: id
    }
  })
}
export function getDetailList (id) {
  return request({
    url: '/pc/management/order/detailOrderlist',
    method: 'post',
    data: {
      token: token,
      id: id
    }
  })
}
export function getExport (startTime, endTime, userIdCard, projectId, salesOrderId, userName, userPhone) {
  return request({
    url: '/pc/management/order/export',
    method: 'get',
    data: {
      token: token,
      startTime: startTime,
      endTime: endTime,
      userIdCard: userIdCard,
      projectId: projectId,
      salesOrderId: salesOrderId,
      userName: userName,
      userPhone: userPhone
    }
  })
}
export function addLocalOrder (id, salesOrderId) {
  return request({
    url: '/pc/management/SalesOrder/addLocalOrder',
    method: 'POST',
    data: {
      token: token,
      id: id,
      salesOrderId: salesOrderId
    }
  })
}
export function  getContact(page,pageSize) {
  return request({
    url: '/pc/management/SalesOrder/getlist',
    method: 'POST',
    data: {
      draw:1,
      token: token,
      page: page,
      pageSize: pageSize
    }
  })
}
export function  setContact(id,salesOrderId) {
  return request({
    url: '/pc/management/SalesOrder/addLocalOrder ',
    method: 'POST',
    data: {
      id:id,
      token: token,
      salesOrderId
    }
  })
}
 
